package com.CusterRelSys.service.impl;

import com.CusterRelSys.entity.CstLost;
import com.CusterRelSys.mapper.CstLostMapperDxy;
import com.CusterRelSys.service.ICstLostServiceDxy;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by AugusDuan on 2017/12/1.
 */
@Service("cstLostService")
public class CstLostServiceImplDxy implements ICstLostServiceDxy {
    @Autowired
    CstLostMapperDxy cstLostMapper;


    /**
     * 查询流失的客户
     * @param cstLost
     * @return
     */
    @Override
    public List<CstLost> showCstLostAll(CstLost cstLost,int pageNum,int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return cstLostMapper.showCstLostAll(cstLost);
    }

    /**
     * 根据ID查找用户
     * @param lstId
     * @return
     */
    @Override
    public CstLost detailCstLostById(Integer lstId) {
        return cstLostMapper.detailCstLostById(lstId);
    }

    /**
     * 根据ID追加原因
     * @param cstLost
     * @return
     */
    @Override
    public int insertCsLost(CstLost cstLost) {
        return cstLostMapper.insertCsLost(cstLost);
    }

    @Override
    public int insertCsLostReaason(CstLost cstLost) {
        return cstLostMapper.insertCsLostReaason(cstLost);
    }
}
